package organizer;

import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Lists the contents of a directory.
 * 
 * @author dawong
 */
public class FileNodeReader implements INodeReader<File> {

    public List<File> getChildren(File node) {
        File[] files = node.listFiles();
        if (files != null)
            return Arrays.asList(files);
        return Collections.emptyList();
    }

    public boolean hasChildren(File node) {
        return node.isDirectory();
    }

}
